home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
pctj8404.arc
/
BOUNCE.BAS
< prev
next >
Wrap
BASIC Source File
|
1986-09-14
|
2KB
|
54 lines
1000 'Test routine for BOUNCE menu subroutine at 10000
1001 '
1002 '
1010 CLS
1020 BNUM=6:BX=25:BY=7:OLDBOUNCE=3:RESTORE 5050:GOSUB 10000 'Call BOUNCE
1030 IF ESCAPE=1 THEN CLS:PRINT"Aborted Choice":END 'Show choice
1040 CLS:PRINT"Bounce choice=";BOUNCE:END
1998 '
1999 '
5000 'Data statement archive
5001 '
5050 DATA "Set Time and Date","Enter Weekly Timesheets","Issue Paychecks","Issue W2 Forms","Update GL Master","Give Boss a Raise"
5999 '
9999 '
10000 '>>>>>Subroutine: Bounce
10010 '
10020 ESCAPE=0:BG=7:FG=0:LOCATE BY,BX,0 'Display menu choices
10030 FOR I=1 TO BNUM
10040 READ BB$(I):PRINT TAB(BX);CHR$(254);" ";BB$(I)
10050 PRINT
10060 NEXT
10070 BOUNCE=OLDBOUNCE:GOSUB 10300 'Highlight old choice #
10079 '
10080 'Keyboard polling loop
10090 '
10100 X$="":WHILE LEN(X$)=0:X$=INKEY$:WEND 'Get a keypress
10120 IF ASC(X$)=13 THEN COLOR 7,0:RETURN 'Was it (CR)?
10125 IF ASC(X$)=27 THEN ESCAPE=1:COLOR 7,0:RETURN 'Was it ESC?
10130 IF LEN(X$)<2 THEN SOUND 50,7:GOTO 10100 'Is it Extended?
10170 IF ASC(MID$(X$,2,1))=72 THEN 10240 'Is it up arrow?
10180 IF ASC(MID$(X$,2,1))<>80 THEN SOUND 50,7:GOTO 10100 'Down arrow?
10189 '
10190 OLDBOUNCE=BOUNCE 'Bounce down
10200 IF BOUNCE=BNUM THEN BOUNCE=1 ELSE BOUNCE=BOUNCE+1
10210 SWAP BOUNCE,OLDBOUNCE:GOSUB 10350 'Unhighlight old
10220 SWAP BOUNCE,OLDBOUNCE:GOSUB 10300 'Highlight new
10230 GOTO 10100
10239 '
10240 OLDBOUNCE=BOUNCE 'Bounce up
10250 IF BOUNCE=1 THEN BOUNCE=BNUM ELSE BOUNCE=BOUNCE-1
10260 SWAP BOUNCE,OLDBOUNCE:GOSUB 10350 'Unhighlight old
10270 SWAP BOUNCE,OLDBOUNCE:GOSUB 10300 'Highlight new
10280 GOTO 10100
10290 '
10300 '>>Minisub: Highlight Line
10310 '
10320 COLOR FG,BG:LOCATE BY+((BOUNCE-1)*2),BX+2:PRINT BB$(BOUNCE)
10330 RETURN
10340 '
10350 '>>Minisub: Normalize Line
10360 '
10370 BG=0:FG=7:GOSUB 10300:BG=7:FG=0
10380 RETURN